<!DOCTYPE html>
<html lang="en" style="background:#fff;">
<head>
    <base href="${basePath}">
    <#include "common/top.html"/>
</head>
<body style="background:#fff;overflow: hidden">
<form class="layui-form" modelAttribute="sysUser" name="form1" id="form1" method="post">
    <div class="layui-form-item-dept">

        <div class="layui-form-item">
            <label class="layui-form-label">EHR号：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="userId" id="userId" maxlength="50"
                       value="${sysUser.userId}"
                       placeholder="这里输入EHR号" title="EHR号"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">名字：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="userName" id="userName"
                       value="${sysUser.userName}" maxlength="50"
                       placeholder="这里输入名字" title="名字"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">EHR号密码：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="passWord" id="passWord" maxlength="50"
                       placeholder="这里输入EHR号密码" title="EHR号密码"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">手机号：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="phone" id="phone"
                       value="${sysUser.phone}" maxlength="50"
                       placeholder="这里输入手机号" title="手机号"/>
            </div>
        </div>

    </div>
</form>
</body>
<script type="text/javascript">

    layui.use(['form', 'table', 'laydate'], function () {
        var form = layui.form;
        var laydate = layui.laydate;

        laydate.render({
            elem: '#modifyTime'
        });

        laydate.render({
            elem: '#lastModifyPwd'
        });

        $("#loginType  option").each(function () {
            if ($(this).val() == "${sysUser.loginType}") {
                $(this).attr("selected", true)
            }
        });
        laydate.render({
            elem: '#lastLoginTime'
        });

        form.render();

    });


    function submitHandler() {
        var prefix = basePath + "system/user";

        $.operate.post(prefix + '/updateSysUser', $("#form1").serializeArray(), function (result) {
            if (result.status == true) {
                layer.alert(result.msg, function (index) {
                    var index1 = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(index1);
                    layer.close(index);
                });
            } else {
                parent.layer.alert(result.msg);
            }
        });
    }
</script>
</body>
</html>
